package jianzhiOffer;

public class num52 {
    public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
        ListNode noed1 = headA;
        ListNode node2 = headB;
        while(noed1 != node2) {
            noed1 = noed1 == null?headB :noed1.next;
            node2 =node2 == null?headA : node2.next;
        }
        return noed1;
    }
}
